package com.zhangwei.service.impl;


import com.zhangwei.mapper.GlobalConfigMapper;
import com.zhangwei.pojo.GlobalConfig;
import com.zhangwei.service.GlobalConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class GlobalConfigServiceImpl implements GlobalConfigService {

    @Autowired
    GlobalConfigMapper globalConfigMapper;

    @Override
    public List<GlobalConfig> selectAll() {

        List<GlobalConfig> list= globalConfigMapper.selectAll();
//        log.info("获取全局配置列表：{}",list);
        return list;
    }

    @Override
    public GlobalConfig selectById(int id) {
        return globalConfigMapper.selectById(id);
    }

    @Override
    public int insertOne(GlobalConfig glableConfig) {
        return globalConfigMapper.insertOne(glableConfig);
    }

    @Override
    public int delById(int id) {

        return globalConfigMapper.delById(id);
    }

    @Override
    public int updateOne(GlobalConfig globalConfig) {

//        System.out.println("access  update  1111111111");
        System.out.println(globalConfig.getId()+globalConfig.getCkey());
        return globalConfigMapper.updateOne(globalConfig);
    }
}
